﻿using UnityEditor;
using UnityEngine;

namespace ExcelTool
{
#if UNITY_EDITOR
    public class EditorLoader : IDataLoader
    {
        public void LoadConfig(string path, loadConfigCallBack callBack)
        {
            var loader = AssetDatabase.LoadAssetAtPath<TextAsset>(path);
            if (loader.bytes == null)
            {
                callBack.FailureCallBack?.Invoke();
            }
            callBack.SuccessCallBack?.Invoke(loader.bytes);
        }
    }
#endif
}